Skip to main content

Terraform Variable

The Terraform Variable tab allows you to specify and manage module variables required by Terraform configurations for precise customization. Variables can be defined per workspace to tailor deployments to your cloud environment.

Overview

You can add, edit, or remove key-value pairs representing Terraform variables. These variables are passed to your module during execution to configure infrastructure resources dynamically.

AWS Example

When using AWS as your target environment, typical variables may include:

Terraform Variables for AWS Example
KeyDescriptionExample Value
bucket_nameName of the S3 bucket to create or managetest1
regionAWS region for resource deploymentus-east-1
environmentEnvironment label (e.g., dev, prod)dev
ownerOwner or responsible teamms

GCP Example

When using GCP as your target environment, variables typically include project and network configuration:

Terraform Variables for GCP Example
KeyDescriptionExample Value
project_idGCP project identifieratmosly-439606
regionGCP region for deploymentus-central1
network_nameName of the VPC networkmy-custom-vpc-ms
subnet_nameSubnet name within the VPCmy-subnet-ms
subnet_ipSubnet IP range10.0.1.0/24

Managing Variables

  1. Navigate to Workspace Details > Terraform Variable.
  2. Click the pencil icon next to any variable to edit its value.
  3. To delete a variable, click the trash icon.
  4. Use the Add Variable button (if available) to define new key-value pairs.
  5. Click Save to apply changes.

Tip: Ensure variable names match those expected in your Terraform modules to avoid configuration errors during deployment.